package com.base.component.ai.workflow.result;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.base.component.ai.agent.bo.ContextBO;
import com.base.component.ai.agent.bo.ContextParamBO;

@Component
public class NodeResultText<MSG,AP extends ContextParamBO,PP> implements NodeResult<MSG,AP,PP> {

	@Override
	public boolean support(String fieldName) {
		return "text".equals(fieldName);
	}

	@Override
	public void execute(ContextBO<MSG, AP, PP> context,Map<String,Object> params) {
		for(String key:params.keySet()) {
			context.getFrameConsumer().accept(params.get(key));
		}
	}

}
